package com.bt.dmdb.service.impl;

import java.io.Serializable;
import org.springframework.transaction.annotation.Transactional;
import com.bt.dmdb.dao.GenericDao;
import com.bt.dmdb.service.GenericService;

public abstract class GenericServiceImpl<T, ID extends Serializable> implements GenericService<T, ID> {

    public abstract GenericDao<T, ID> gd();

    @Override
    @Transactional(value = "txmDmdb")
    public ID insert(T t) {
        return gd().insert(t);
    }

    @Override
    @Transactional(value = "txmDmdb")
    public T create(T t) {
        return gd().create(t);
    }

    @Override
    @Transactional(value = "txmDmdb")
    public T retreive(ID id) {
        return gd().retreive(id);
    }

    @Override
    @Transactional(value = "txmDmdb")
    public void update(T t) {
        gd().update(t);
    }

    @Override
    @Transactional(value = "txmDmdb")
    public void delete(T t) {
        gd().delete(t);
    }
}
